package com.xiaoxu.springboot.modules.test.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xiaoxu.springboot.modules.common.entity.AbstractEntity;

import javax.persistence.*;

@Entity
@Table(name = "test_card")
public class Card extends AbstractEntity {
    @Column(name = "card_no", length = 33, unique = true)
    private String cardNo;

    @OneToOne(mappedBy = "studentCard", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JsonIgnore
    private Student student;

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }
}
